package blog.spring.web.util;

import javax.servlet.http.HttpServletRequest;

public class WebUtils {

	public static String getCurentRequestUrl(HttpServletRequest request) {
		String url = "";
		// url = request.getScheme() + "://"; // 请求协议 http 或 https
		// url += request.getHeader("host"); // 请求服务器
		url += request.getRequestURI(); // 工程名
		url = url.substring(1, url.length());
		System.out.println(url);
		// if (request.getQueryString() != null) // 判断请求参数是否为空
		// url += "?" + request.getQueryString(); // 参数
		return url;
	}
}
